#include <algorithm>

#include <boost/bind.hpp>

#include <kugou/server/http/HTTPConnectionManager.h>

namespace kugou
{
namespace server
{
namespace http
{

void HTTPConnectionManager::start(ConnectionSharePtr c)
{
    this->m_connections.insert(c);
    c->start();
}

void HTTPConnectionManager::stop(ConnectionSharePtr c)
{
    this->m_connections.erase(c);
    c->stop();
}

void HTTPConnectionManager::stopAll()
{
    std::for_each(this->m_connections.begin(),this->m_connections.end(),boost::bind(&HTTPConnection::stop, _1));

    this->m_connections.clear();
}

} // http    
} // server
} // kugou
